home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 189 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  15.6 KB

  1. Path: solon.com!not-for-mail
  2. From: softbase@mercury.interpath.com (Scott McMahan - Softbase Systems)
  3. Newsgroups: comp.lang.c.moderated,comp.lang.c,comp.std.c
  4. Subject: Re: Perhaps it's time the C community *did* something about bad books.
  5. Followup-To: comp.lang.c.moderated,comp.lang.c,comp.std.c
  6. Date: 25 Jan 1996 20:41:12 -0600
  7. Organization: Interpath -- Providing Internet access to North Carolina
  8. Sender: clc@solutions.solon.com
  9. Approved: clc@solutions.solon.com
  10. Message-ID: <4e9f08$9br@solutions.solon.com>
  11. References: <4e07lv$adu@solutions.solon.com> <4e5ooa$6b5@solutions.solon.com>
  12. NNTP-Posting-Host: solutions.solon.com
  13. X-Newsreader: TIN [version 1.2 PL2]
  14.  
  15. Ray Dunn (ray@ultimate-tech.com) wrote:
  16. : In referenced article, Peter Seebach says...
  17. : >I call your attention to Schildt's "C: The Complete Reference". 
  18. : There is a long crit of this book, with many errors listed, at:
  19. : http://bit.csc.lsu.edu/tutorial/ten-commandments/schildt.html
  20.  
  21. Not exactly. This is actually the review of the ANSI C standard.
  22. The "review" errs on the side of being way too critical, and I've
  23. seen it being debunked in part, but the parts that are debunked
  24. never seem to be posted with the review anywhere. It's one of those
  25. things that will endure forever.
  26.  
  27. I did not see the post that listed errors in C: TCR. I'm interested
  28. in reading it.
  29.  
  30. I agree that we should all make Osborne aware of all the errors in
  31. Mr. Schildt's book so that he can make them better in future
  32. editions. I was very disappointed in the 3rd Ed. compared to 
  33. the 2nd.
  34.  
  35. Scott
  36.  
  37. PS: Here is the review of the 3rd Ed I wrote when I got it last
  38. summer.
  39.  
  40. C: The Complete Reference, Third Edition
  41. By Herbert Schildt, published by Osborne/McGraw-Hill
  42. ISBN 0-07-882101-0
  43.  
  44. A review by Scott McMahan, July-August 1995
  45.  
  46. ---------------------------------------------------------------------------
  47.  
  48. I finally got my copy of C: The Complete Reference -- not a review copy,
  49. as I've never been able to make contact with any Osborne press people.
  50. I don't know if they even send out review copies, but if they do I've
  51. never been able to get my foot in the door.  I thought I'd give the book
  52. a once over anyway. It took me some time to complete this review, for
  53. various reasons, so it isn't as timely as I thought. On the other hand,
  54. the third edition seems to have been released in extreme secrecy since I
  55. learned about it only though a McGraw-Hill book-of-the-month club ad.
  56.  
  57. Way back when, I learned C using Schildt's Teach Yourself C, and have
  58. always had a soft spot for his writing.  He is a capable author who has
  59. the ability to simplify complex topics enough for people who have not
  60. had exposure to them before.  I'm certainly not suggesting his books can
  61. replace Sedgewick's Algorithms In C or K&R2 (both of which I consult
  62. regularly), but they give a kinder, gentler approach to topics that
  63. prepares you for the more precise and "heavy" books you'll have to read
  64. later on.  If anyone is willing to give Herbert Schildt a fair shake, it
  65. would be me, since I have benefitted from his writing in the past and
  66. have read a significant number of his books.  I've even defended some of
  67. the wilder acusations about Schildt on the net, but after the third
  68. edition I don't think I'll bother.  I intend to send a copy of this
  69. review to him in care of his consulting office in order to hopefully
  70. make the fourth edition much better than the third.
  71.  
  72. Just picking up the book, one obvious thing is the print is smaller.
  73. Holding it up to an earlier book like Turbo C/C++:  The Complete
  74. Reference 1st edition makes the difference startling.  Paper costs have
  75. gone up tremendously in the past few years, and shrinking the type books
  76. and other things are set in is very common. It's unfortunate for the
  77. eyes.
  78.  
  79. The page layout has been revamped, with little improvement. Big grey
  80. bands set off code from the text, which is unnecessary and makes the
  81. chapters on functions (each of which comes with an example program) very
  82. chaotic looking. The bands overpower the headers, which is what you're
  83. skimming for.  Compare the stylized 'C' with the logo of my C And C++
  84. Review -- wavy pixilated designs with the foreground blurred into the
  85. background.  I'm sure this is nothing but a coincidence.
  86.  
  87. What's up in the third edition?
  88.  
  89. Unfortunately, Schildt has chosen not to correct the void main(void)
  90. anachronism. From what I understand, the usage which is clearly and
  91. flagrantly contrary to the ANSI standard is a throwback to pre-ANSI DOS
  92. C compilers' rather strange ideas on returning values to the calling
  93. environment. (I don't know why this is even a problem, as returning a
  94. value in register AX is incredibly commonplace to any DOS program. Most
  95. assembly language utilities you run across return a value to DOS use
  96. register AX for their processing to kill two birds in one stone: #1 not
  97. having to clean up the register, and #2 returning the value as a
  98. side-effect of the computation.)
  99.  
  100. To make this issue even more bizarre, Schild says on page 163: "The
  101. main() function returns an integer to the calling process, which is
  102. generally the operating system." The part is absolutely true (the part
  103. about the operating system isn't -- usually programs are started by some
  104. type of command interpreter doing an exec() or spawn() call, and the
  105. command interpreter gives some meaning to the return value). Then, from
  106. this very stable ground of ANSI behavior, Schildt takes a flying leap
  107. off a cliff and says in the next paragraph: "You may also declare main()
  108. as void if it does not return a value". Since he has just said in the
  109. preceeding paragraph: "If main() does not return a value, the value
  110. passed to the calling process is technically undefined. In practice,
  111. most C compilers automatically return 0, but do not rely on this
  112. behavior if portability is a concern." -- it makes me wonder why he
  113. doesn't just explicitly return a value, instead of hoping for the best
  114. from undefined behavior?  (And remember what undefined means: The C
  115. compiler can do ANYTHING it wants, including what the GNU compiler did
  116. to protest the inclusion of #pragma in the standard, start a game of
  117. rogue.) A void-declared main is undefined. An integer-declared main is
  118. defined, and just returns garbage. Garbage is better than undefined
  119. behavior.
  120.  
  121. The silliest thing is "main()" is a lot easier to write than "void
  122. main(void)", which is equivalent to using stilted, awkward phraseology
  123. in English. As a writer, Schildt should at least have his inner ear
  124. tuned to the easiest, best-flowing way to phrase things. Additional
  125. silliness comes from the fact that some of the material is 5-10 years
  126. old, and some of it is brand new. Thus some parts of the book use void
  127. main(void) and some don't. The little C interpreter, for example, does
  128. not parse this syntax. (It was, in fact, written before ANSI C, and its
  129. syntax doesn't include the ANSI keywords -- as much as Schildt likes his
  130. void affectation, this is surprising. Adding the "void" keyword to an
  131. interpreter would be little more difficult than ignoring the word
  132. "void".) Another example is that all the Windows' functions are declared
  133. as "int WINAPI WinMain", which makes little sense as the return value of
  134. a WinMain is as clearly defined as the return value of an ANSI C
  135. function.  If one definition of program behavior is to be ignored, why
  136. aren't all? This is inconsistent.  It should be void WINAPI WinMain.
  137. This is as undefined as the ANSI C definition of main()'s declaration.
  138.  
  139. The book is still very much PC based.  It isn't a true ANSI C reference
  140. like the book would like to mislead you with the front and back cover
  141. copy. This is unfortunate, because the truth-in-advertising issue gives
  142. Schildt a lot of bad press. If they just said "for PC programmers" on
  143. the cover, they'd eliminate a lot of the vitriol the book receives. A
  144. lot of stuff is outright PC based (as described below) and would work on
  145. nothing but a PC.  A lot of the other stuff is based on the assumption
  146. that you're on a PC (such as the size of a word is a 16 bit half-word).
  147. It would work, but differently, in other environments. This is the
  148. dangerous stuff. Instead of calling it a Complete Reference, it would be
  149. a lot more precise to say that the book is a superset of ANSI C for PC
  150. programmers.  (I think "complete" is a joke anyway, like the "complete"
  151. Internet reference. How can anything written about the Internet be
  152. complete...!?!)
  153.  
  154. In addition, Schildt discusses only the Microsoft and Borland compilers!
  155. No mention of Mix, GNU, Watcom, or any others.  This isn't a complete PC
  156. reference, either. If you're going to talk about PC compilers, and be
  157. complete, you need to cover compilers as popular as Mix's Power C. I
  158. understand a book like Turbo C/C++: The Complete Reference covering one
  159. specific compiler, but when the door is opened to all PC C compilers,
  160. coverage of the major players is necessary.
  161.  
  162. Topics of interest to PC programmers include:
  163.  
  164.     The segmented 80x86 memory model, which is a non-issue now that
  165.     Windows 95 allows you to write flat memory model programs (the
  166.     same Windows 95 about which a chapter is included in this very
  167.     book, see below);
  168.  
  169.     Microsoft C/C++ console graphics functions (which are for some
  170.     inexplicable reason claimed to have been deleted, in the
  171.     introduction, but are still present in the text! Chapter 17 is
  172.     nothing but the Microsoft C/C++ 7 DOS-mode graphics chapter in
  173.     the MS manual, warmed over);
  174.  
  175.     DOS assembly language, both compiler output (for efficiency
  176.     purposes, ironically he's using an old CISC chip for his
  177.     efficiency material) and for interfacing C and asm.
  178.  
  179. That's an interesting cross-section of DOS. Lots of bizarre looking
  180. functions like "_intdos" and "_intdosx" appear, which some compilers
  181. allow you to use. (Come on, if you're going to call DOS interrupts, why
  182. not use embedded assembly language? If you're going to be non-standard,
  183. using the nonstandard asm keyword is a lot more explicit! The asm
  184. keyword is more widespread, at least, and the assembly language screams
  185. "I'm a non-standard module".)
  186.  
  187. On p.  8, Schildt claims spreadsheets are systems programs.  I never
  188. really considered that to be true, but then again OS/2 Warp does, in
  189. fact, ship with a spreadsheet as part of the basic OS package.  I guess
  190. times change.  Once, spreadsheets were applications that you had to (and
  191. still have to if you want to do anything serious) buy on your own.  As
  192. you can guess, this is probably a result of the years of cutting and
  193. pasting done to the book.
  194.  
  195. What's new?  The third edition is surprisingly unchanged. Instead of
  196. taking the chance to reflect on which chapters he has written in his
  197. almost 10 years of writing on C and picking the ones that would be most
  198. useful to an ANSI C programmer, Schildt has instead placed chapters that
  199. have little to do with a complete reference, including a tacky
  200. self-promotion.
  201.  
  202. A C interpreter:  this is from the out of print book Born To Code In C,
  203. although I am under the impression that the material in Born was also
  204. reused in The Art Of C and The Craft Of C.
  205.  
  206. It is hillarious to contrast the wording between Born To Code In C,
  207. where the C interpreter is in the first chapter, to the third edition,
  208. where it is in the last chapter.  Either one by itself reads fine, but
  209. when you contrast them side-by-side, the results of the cut & paste job
  210. are side-splitting as Schildt's enthusiasm and sincerity are shattered
  211. when you see how he changed a couple of lines.
  212.  
  213. The good thing, though, is that the interpreter source code is readily
  214. available.  It's not a bad program, although I haven't typed it all in.
  215. It looks like it does a decent job. A lot of people want to have a C
  216. interpreter. With Born To Code In C out of print, this makes it availble
  217. to everyone.
  218.  
  219. (This is another big beef I have with the book: the blasted thing is
  220. $35, you think that they could have put a disk with the source code in
  221. with the book! I've seen books a lot cheaper than this with disks.)
  222.  
  223. It's nice to have the interpreter and the recursive descent parser in
  224. the same book.  (Schildt's continued insistence -- probably more because
  225. he didn't read the chapter on the parser when he cut & paste it than
  226. anything intentional -- that recursive descent parsing is somehow
  227. mysterious or secret is not really in keeping with the times.  Most
  228. college CS courses on recursion cover them.  The only people to whom
  229. recursive descent parsing would be mysterious are users who are not
  230. sophisticated enough to understand algorithms in general.)  Having them
  231. separated makes referencing one while reading the other a pain,
  232. especially when one book is at home and the other at work.
  233.  
  234. (Perhaps a coincidence, perhaps not:  the section on ideas to extend the
  235. interpreter has as one suggestion adding an integrated editor: exactly
  236. what Quincy, the interpreter Dr. Dobbs' Al Stevens wrote.)
  237.  
  238. I almost took the book back and demanded a refund when I saw this. A
  239. chapter on Windows 95 is nothing but a shameless, tacky ad for Schildt's
  240. new Windows 95 Programming book.  They should have put this chapter at
  241. the back of the book and clearly labeled it as an ad.  Windows 95
  242. programming has no place in a generic ANSI C book.  Schildt just took a
  243. chapter out of his Windows 95 book and pasted it in here. It is not ANSI
  244. C, it is not even particularly C, it has nothing at all to do with a
  245. "complete" reference since the skeleton doesn't do anything, and
  246. all-around is just plain bad. The bad feelings generated by this
  247. sickening ad will more than destroy any small sales increase M-H gets.
  248.  
  249. What isn't new is the sad part -- with the disgusting ad and the C
  250. interpreter (which although useful is certainly not anything you'd
  251. expect in a C reference), Schildt did not include the chapters from
  252. Advanced C on statistics and random number generation.  For an ANSI C
  253. programmer, this material would have been much more useful.  People are
  254. asking for random number generators all the time on comp.lang.c, and the
  255. older Advanced C book has several. Advanced C, which is now out of
  256. print, has a lot of information that would be useful to the general ANSI
  257. C programmer. I asked Schildt to consider including these chapters, to
  258. which he responded with a positive message that he'd consider it, and
  259. yet greed and advertising won out over the usefulness the book would
  260. have had to people. I see requests for random number generators on
  261. comp.lang.c frequently. It is material people have an interest in and
  262. need to know regardless of what C implementation is used.
  263.  
  264. There's also not much on hashing, one of the fundamental things you need
  265. to do in C.  I had to write a hash very recently, so I though I'd see
  266. what Schildt said about it.  Very little, as it turned out, and only as
  267. an aside in a chapter on sparse arrays.  The bad part is, he doesn't
  268. explain hashing much at all and only has an example of closed hashing.
  269. (My own table, for example, was open hashed.  I had a situation where
  270. open hashing made the most sense.  Who names these things, anyway?  The
  271. type of hashing with a finite number of slots in the table is "open" and
  272. not "closed"?)
  273.  
  274. Unless Schildt starts trying to find what people want and starts
  275. remembering why he wrote C:  The Complete Reference in the first place,
  276. he and Osborne are going to have a hard time selling books with ads for
  277. other books instead of content and using Schildt's name.  Schildt is
  278. already known as a schmuck among real C programmers, deservedly or not,
  279. and pretty soon everyone will be calling him the "recognized authority"
  280. on self-promotion and hot air. Either Schildt or McGraw-Hill appears to
  281. be damaging Schildt's already very shakey reputation beyond repair for
  282. small short-term gain. I don't know why, is Osborne in some kind of
  283. financial trouble? They should be trying to build a reputation for
  284. quality.
  285.  
  286. Unfortunately for me, I will probably never order another edition of
  287. this book, unless the concerns raised here are directly addressed.  I'm
  288. very disenchanted with this book, and will look elsewhere for my
  289. reference material.
  290.